Skip to content

interfaces/builtin: add xdg-portal-permission-store interface - #17029

Merged
bboozzoo merged 2 commits into
canonical:masterfrom
quine00:impl-pps
Jun 11, 2026
Merged

interfaces/builtin: add xdg-portal-permission-store interface#17029
bboozzoo merged 2 commits into
canonical:masterfrom
quine00:impl-pps

Conversation

@quine00

@quine00 quine00 commented May 6, 2026

Copy link
Copy Markdown
Contributor

Provide a dedicated super-privileged interface for xdg-desktop-portal PermissionStore access

@quine00

quine00 commented May 6, 2026

Copy link
Copy Markdown
Contributor Author

Related to: #15338

@olivercalder olivercalder self-assigned this May 6, 2026
@olivercalder olivercalder added Needs Samuele review Needs a review from Samuele before it can land Needs security review Can only be merged once security gave a :+1: Needs Documentation 📖 labels May 6, 2026
@github-actions

github-actions Bot commented May 6, 2026

Copy link
Copy Markdown

Thu Jun 11 11:53:12 UTC 2026
The following results are from: https://github.com/canonical/snapd/actions/runs/27267577019

Failures:

Preparing:

  • openstack:opensuse-tumbleweed-selinux-64:
  • openstack:opensuse-tumbleweed-selinux-64:
  • openstack:opensuse-tumbleweed-64:
  • openstack:opensuse-tumbleweed-64:
  • openstack:opensuse-tumbleweed-64:
  • openstack:opensuse-tumbleweed-selinux-64:
  • openstack:opensuse-tumbleweed-selinux-64:
  • openstack:opensuse-tumbleweed-64:
  • openstack:opensuse-tumbleweed-selinux-64:
  • openstack:opensuse-tumbleweed-64:
  • openstack:opensuse-tumbleweed-selinux-64:
  • openstack:opensuse-tumbleweed-64:
  • google-pro:ubuntu-fips-24.04-64:
  • google-pro:ubuntu-fips-22.04-64:
  • google-pro:ubuntu-fips-22.04-64:
  • google-pro:ubuntu-fips-24.04-64:

Executing:

  • openstack:debian-sid-64:tests/main/interfaces-xdg-portal-permission-store
  • garden:ubuntu-core-18-64:tests/core/auto-refresh-backoff-after-reboot:kernel

Restoring:

  • openstack:opensuse-tumbleweed-selinux-64:
  • openstack:opensuse-tumbleweed-selinux-64:
  • openstack:opensuse-tumbleweed-64:
  • openstack:opensuse-tumbleweed-64:
  • openstack:opensuse-tumbleweed-64:
  • openstack:opensuse-tumbleweed-selinux-64:
  • openstack:opensuse-tumbleweed-64:
  • openstack:opensuse-tumbleweed-64:
  • openstack:opensuse-tumbleweed-selinux-64:
  • openstack:opensuse-tumbleweed-selinux-64:
  • openstack:opensuse-tumbleweed-selinux-64:
  • openstack:opensuse-tumbleweed-64:

Skipped tests from snapd-testing-skip

If you wish to have any of the below tests run in your PR, in your PR description, add 'unskip:' followed by a copy-and-pasted list (without variants) of the below tests you wish to run (unskip plus test list must be valid yaml)

  • garden:ubuntu-25.10-64:tests/main/apparmor-prompting-support
  • openstack-arm:ubuntu-24.04-arm-64:tests/main/i18n
  • openstack-arm:ubuntu-core-24-arm-64:tests/main/i18n
  • openstack:debian-sid-64:tests/main/interfaces-network-status-classic
  • openstack:ubuntu-24.04-64:tests/main/i18n
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-flag-restart
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:audio_record_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:audio_record_timespan_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:audio_record_timespan_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_actioned_by_other_pid_always_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_actioned_by_other_pid_always_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_not_actioned_by_other_pid_single_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_not_actioned_by_other_pid_single_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_write_chmod_same_fd_single_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_write_chmod_same_path_single_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_write_write_same_path_single_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:download_file_conflict
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:download_file_defaults
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:download_file_safer
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:read_single_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:read_single_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:special_characters
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:timespan_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:timespan_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:write_read_multiple_actioned_by_other_pid_allow_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:write_read_multiple_actioned_by_other_pid_deny_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:write_single_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:write_single_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-prompt-restoration
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_allow_forever
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_allow_session
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_allow_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_allow_timespan
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_deny_forever
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_deny_session
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_deny_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_deny_timespan
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_allow_forever
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_allow_session
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_allow_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_allow_timespan
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_deny_forever
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_deny_session
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_deny_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_deny_timespan
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_allow_forever
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_allow_session
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_allow_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_allow_timespan
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_deny_forever
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_deny_session
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_deny_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_deny_timespan
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-snapd-startup
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-support
  • openstack:ubuntu-25.10-64:tests/main/interfaces-requests-activates-handlers
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-flag-restart
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:audio_record_single
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:audio_record_timespan_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:audio_record_timespan_deny
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:create_multiple_actioned_by_other_pid_always_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:create_multiple_actioned_by_other_pid_always_deny
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:create_multiple_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:create_multiple_deny
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:create_multiple_not_actioned_by_other_pid_single_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:create_multiple_not_actioned_by_other_pid_single_deny
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:create_write_chmod_same_fd_single_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:create_write_chmod_same_path_single_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:create_write_write_same_path_single_deny
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:download_file_conflict
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:download_file_defaults
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:download_file_safer
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:read_single_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:read_single_deny
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:special_characters
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:timespan_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:timespan_deny
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:write_read_multiple_actioned_by_other_pid_allow_deny
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:write_read_multiple_actioned_by_other_pid_deny_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:write_single_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:write_single_deny
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-prompt-restoration
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:audiorecord_allow_forever
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:audiorecord_allow_session
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:audiorecord_allow_single
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:audiorecord_allow_timespan
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:audiorecord_deny_forever
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:audiorecord_deny_session
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:audiorecord_deny_single
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:audiorecord_deny_timespan
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:camera_allow_forever
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:camera_allow_session
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:camera_allow_single
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:camera_allow_timespan
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:camera_deny_forever
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:camera_deny_session
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:camera_deny_single
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:camera_deny_timespan
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:home_allow_forever
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:home_allow_session
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:home_allow_single
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:home_allow_timespan
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:home_deny_forever
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:home_deny_session
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:home_deny_single
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:home_deny_timespan
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-snapd-startup
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-support
  • openstack:ubuntu-26.04-64:tests/main/i18n
  • openstack:ubuntu-26.04-64:tests/main/interfaces-requests-activates-handlers

@codecov

codecov Bot commented May 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.12%. Comparing base (01b3b10) to head (257bb53).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #17029      +/-   ##
==========================================
- Coverage   79.18%   79.12%   -0.06%     
==========================================
  Files        1374     1387      +13     
  Lines      193037   193283     +246     
  Branches     2466     2466              
==========================================
+ Hits       152855   152937      +82     
- Misses      30994    31160     +166     
+ Partials     9188     9186       -2     
Flag Coverage Δ
unittests 79.12% <100.00%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@quine00

quine00 commented May 7, 2026

Copy link
Copy Markdown
Contributor Author

It seems like the 4 failing checks are flakes? They don't appear related to this PR.

Comment thread tests/lib/snaps/test-snapd-policy-app-consumer/meta/snap.yaml Outdated
@quine00 quine00 changed the title interfaces/builtin: add xdg-permission-store interface interfaces/builtin: add xdg-portal-permission-store interface May 7, 2026
@quine00

quine00 commented May 20, 2026

Copy link
Copy Markdown
Contributor Author

Pinging for snapd team review

@pedronis pedronis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks OK to me

@olivercalder olivercalder left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally LGTM, I'm wondering if there's a way to test that a snap with this interface can actually interact with the PermissionStore as expected.

Comment thread tests/lib/snaps/test-snapd-policy-app-consumer/meta/snap.yaml Outdated
@olivercalder
olivercalder requested a review from 3v1n0 May 25, 2026 18:50
@quine00
quine00 force-pushed the impl-pps branch 2 times, most recently from 6e2d44b to a4251a0 Compare June 2, 2026 13:49

@olivercalder olivercalder left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking great, nice job on the spread test. I'm almost +1, the one blocker for me is making sure we exercise that each of the commands in the test snap fails when the interface is disconnected.

Comment thread tests/lib/snaps/test-snapd-xdg-portal-permission-store/bin/client.sh Outdated
Comment thread tests/main/interfaces-xdg-portal-permission-store/task.yaml Outdated
Comment thread tests/main/interfaces-xdg-portal-permission-store/task.yaml Outdated
Comment thread tests/main/interfaces-xdg-portal-permission-store/task.yaml Outdated
Comment thread tests/main/interfaces-xdg-portal-permission-store/task.yaml Outdated
Comment thread tests/main/interfaces-xdg-portal-permission-store/task.yaml Outdated
Comment thread tests/main/interfaces-xdg-portal-permission-store/task.yaml Outdated
Comment thread interfaces/builtin/xdg_portal_permission_store.go Outdated
@quine00
quine00 force-pushed the impl-pps branch 3 times, most recently from c3b35cb to f1cc07c Compare June 3, 2026 16:23

@olivercalder olivercalder left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, the changes look excellent, thank you!

By the way, we generally avoid amending commits and force-pushing (or even rebasing on master without good reason), as it makes it more difficult to track what changes between reviews. We will squash merge the PR after it's approved, so we'd much rather have a rich commit history during the review process, and we can always clean it up when merging.

@github-actions github-actions Bot added the Auto rerun spread Auto reruns spread up to 4 times in non-draft PRs w/ >=1 approval and <20 fails in any fund. system label Jun 4, 2026
@quine00

quine00 commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

Nice, the changes look excellent, thank you!

By the way, we generally avoid amending commits and force-pushing (or even rebasing on master without good reason), as it makes it more difficult to track what changes between reviews. We will squash merge the PR after it's approved, so we'd much rather have a rich commit history during the review process, and we can always clean it up when merging.

Thanks Oliver, I'll do that in the future here.

I have disabled Arch systems in the new test with the latest commit. There appears to be AppArmor mismatches there.

@quine00

quine00 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

Gentle ping. I don't think any of the CI failures are related to my changes.

@bboozzoo bboozzoo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@bboozzoo bboozzoo added this to the 2.77 milestone Jun 10, 2026
@bboozzoo

Copy link
Copy Markdown
Contributor

@quine00 can you rebase on latest master to include a fix for one of the failing tests?

Charles added 2 commits June 10, 2026 10:41
Provide a dedicated super-privileged interface for xdg-desktop-portal
PermissionStore access.

Also add a spread test that starts a fake PermissionStore service on the
session bus and verifies that a confined snap can only talk to it when
xdg-portal-permission-store is connected.
There appears to be an issue with the version of AppArmor in the Arch
images. Disable for now.

```
2026-06-04 04:49:00 Error executing openstack:arch-linux-64:tests/main/interfaces-xdg-portal-permission-store (jun040444-442035) :
-----
+ apps='ping introspect get-all test'
+ echo 'The interface is initially disconnected'
The interface is initially disconnected
+ snap interfaces -i xdg-portal-permission-store
+ MATCH -- '- +test-snapd-xdg-portal-permission-store:xdg-portal-permission-store'

'snap interfaces' is deprecated; use 'snap connections'.
+ echo 'Without the connection, each PermissionStore access is denied'
Without the connection, each PermissionStore access is denied
+ for app in $apps
+ not tests.session -u test exec test-snapd-xdg-portal-permission-store.ping
ok
```
@quine00

quine00 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

@quine00 can you rebase on latest master to include a fix for one of the failing tests?

Done, thanks for looking.

@quine00

quine00 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

Looking at the CI failures,

  • debian-not-req: seems like a real failure, I should probably skip this target.
  • opensuse: appears to be infra issues
  • ubuntu-fips-*: ditto
  • ubuntu-core-18: unrelated error

@bboozzoo
bboozzoo merged commit 7b06333 into canonical:master Jun 11, 2026
478 of 522 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto rerun spread Auto reruns spread up to 4 times in non-draft PRs w/ >=1 approval and <20 fails in any fund. system Needs Documentation 📖 Needs Samuele review Needs a review from Samuele before it can land Needs security review Can only be merged once security gave a :+1:

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants